package org.jeeasy.system.modules.user.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeeasy.common.core.annotation.convert.BeanTransfer;
import org.jeeasy.common.core.annotation.dict.Dict;
import org.jeeasy.common.core.base.convert.BaseConverter;
import org.jeeasy.common.core.base.convert.BaseTransfer;
import org.jeeasy.system.enums.user.SysUserStatusEnum;
import org.jeeasy.system.modules.dept.domain.SysDept;
import org.jeeasy.system.modules.role.domian.SysRole;
import org.jeeasy.system.modules.user.domain.SysUser;
import org.mapstruct.Mapper;

import java.time.LocalDate;
import java.util.List;

/**
 * @author mobie
 */
@Data
@Schema(description = "系统用户VO")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@BeanTransfer(value = Converter.class)
public class SysUserVo extends BaseTransfer<SysUser> {
    @Schema(description = "ID")
    private String id;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "用户编号")
    private Long userNo;

    @Schema(description = "电话号码")
    private String phone;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "性别", example = "1：男，0：女")
    private Integer sex;

    @Schema(description = "生日")
    private LocalDate birthday;

    //@JsonIgnore
    //@Schema(description = "密码")
    //private String password;
    //
    //@JsonIgnore
    //@Schema(description = "--")
    //private String salt;

    @Schema(description = "状态")
    @Dict(dictEnum = SysUserStatusEnum.class)
    private Integer status;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "头像")
    private String avatar;

    //@Schema(description = "创建时间")
    //@TableField(fill = FieldFill.INSERT)
    //private LocalDateTime createTime;
    //
    //@Schema(description = "创建人")
    //@TableField(fill = FieldFill.INSERT)
    //private String createBy;
    //
    //@Schema(description = "修改时间")
    //@TableField(fill = FieldFill.UPDATE)
    //private LocalDateTime updateTime;
    //
    //@Schema(description = "修改人")
    //@TableField(fill = FieldFill.UPDATE)
    //private String updateBy;

    @Schema(description = "备注")
    private String remark;

    //@TableLogic
    //@Schema(description = "删除标记")
    //private Integer delFlag;

    //private List<SysRole> roleList;
    //private List<SysDept> deptList;

    @Schema(description = "角色列表")
    private List<SysRole> roles;

    @Schema(description = "部门列表")
    private List<SysDept> depts;


}

@Mapper
interface Converter extends BaseConverter<SysUser, SysUserVo> {

}